<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>管理控制台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <link rel="stylesheet" href="/static/admin/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/static/admin/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/admin/css/global.css" media="all">
    @yield('css')
</head>
<body>

<div class="layui-fluid">
    @yield('content')
</div>

<script src="/static/admin/js/jquery.js"></script>
<script src="/static/admin/layuiadmin/layui/layui.js"></script>
<script src="/static/admin/layer/layer.js"></script>
<script src="/static/admin/js/global.js"></script>
<script>
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    layui.config({
        base: '/static/admin/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['element','index','form', 'layer','table', 'upload', 'laydate'], function () {
        var layer = layui.layer;
        //错误提示
        @if(count($errors)>0)
        @foreach($errors->all() as $error)
        layer.msg("{{$error}}", {icon: 5});
        @break
        @endforeach
        @endif
        //信息提示
        @if(session('status'))
        layer.msg("{{session('status')}}", {icon: 6});
        @endif

        @if(session('statusClose'))
        layer.msg("{{session('statusClose')}}", {icon:6, time: 1000,
            end: function () {
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
            }
        });
        @endif

    });
</script>
@yield('script')
</body>
</html>
